package info.fastpace.android.utils;

import info.fastpace.utils.Config;
import android.os.Bundle;

/**
 * A generic activity that can bind/paint an Entity T
 */
public class Activity extends android.app.Activity {

	private boolean active = false;
	
	@Override
	protected final void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
		try {
			onCreateSpecific(savedInstanceState);
		} catch (Exception e) {
			Config.getLog().e("", e);
			finish();
			return;
		}
	}
	
	protected void onCreateSpecific(Bundle savedInstanceState) {
	}
	
	@Override
	protected void onResume() {
		super.onResume();
		active = true;
	}

	@Override
	protected void onPause() {
		active = false;
		super.onPause();
	}
	
	protected boolean isActive() {
		return active;
	}

	protected final android.content.Intent getOriginalIntent() {
		return super.getIntent();
	}
}
